<!--<link href="/static/Content/SystemSetStyle/style/css/index.css" rel="stylesheet" type="text/css" media="all" />-->
<style>
    .btn-submit-m{
        box-shadow: none;
        background: #f18d05;
        color: white!important;
        text-shadow: none;
        border: none;
        height: 27.6px;
        font-size: 12px;
        line-height: 27.6px;
        padding: 0px 20.48px;
        margin: 0;
        text-decoration: none;
        text-align: center;
        cursor: pointer;
        width: 100px;
    }
</style>
<div class="group-tab">
    <div class="mgt-panel mgt-panel-with-button">
        <input type="button" class="btn-submit-m" onclick="BindSellDetail()" value="添加店铺" />
        <i>
        </i>
        <i>
        </i>
    </div>
    <ul class="group-list group-list-title">
        <li>
            <div class="col-item col-pdt-group-name" style="width: 250px;">
                <div class="col-item col-group-pdt">店铺名称 &nbsp;</div>
            </div>
            <div class="col-item col-group-pdt" style="width: 250px;">备注</div>
            <div class="col-item col-pdt-group-expand" style="width: 140px;">&nbsp;&nbsp;&nbsp;&nbsp;添加时间</div>
            <div class="col-item col-group-op">操作</div></li>
    </ul>
    <div id="PermissionsList">
        <ul class="group-list" id="group-main">
            {volist name='data.list' id='vo'}
            <li class="group-item" id="{$vo.id}">
                <div class="col-item col-pdt-group-name" style="width: 250px;">
                    <div id="title-248378" class="group-tree-icon" onclick="scaling('248378')"></div>
                    <div class="group-name">{$vo.name}</div>
                </div>
                <div class="col-item col-group-pdt" style="width: 250px;">{$vo.remark}</div>
                <div class="col-item col-pdt-group-expand" style="width: 140px;">
                    {$vo.add_time|date='Y-m-d H:i:s',###}
                    <!--<div class="expand-switch {eq name='vo.status' value='1'}on{else/}off{/eq}"></div>-->
                </div>
                <div class="col-item col-group-op">
                    <div class="group-mgt-icons j-main-group" data-id="253474801">
                        <a href="javascript:void(0);" class="group-edit" title="修改" onclick="modifyStore({$vo.id})"></a>
                        <a href="javascript:void(0);" class="group-del" title="删除" onclick="entityDel({$vo.id})"></a>
                    </div>
                </div>
            </li>
            {/volist}
        </ul>
    </div>
</div>
<div class="pagination clearfix" id="pagination">
    <input type="hidden" name="totalpage" class="totalpage" value="8" />
    <form name="paginationForm" method="post" action="/wsproduct/manageproduct/manageProductList.htm">
        <input class="gotopage-hide" type="hidden" name="page" value="" />
        <input name='_csrf_token_' type='hidden' value='sgly9lvlblr0'>
        <input type="hidden" name="action" value='' /></form>
    <div class="page-links clearfix">
        {$data.page}
    </div>
</div>
<script>
    $(function() {
    $("#productState").val('');
    $("#selectValue").val('');
    })
            function BindDetail(entityId) {
            var title = '添加';
            if (entityId) {
            title = '修改';
            }
            var index = $.layer({
            type: 1,
                    title: title,
                    shadeClose: false,
                    maxmin: false,
                    fix: false,
                    area: ['430px', 300],
                    page: {
                    url: '../BrushProduc/BindDetail?brushBindId=' + entityId + '&pageIndex=1',
                    }
            //iframe: {
            //    src: '../SystemSet/RoleDetail?RoleId=' + RoleId
            //    //   alert(    document.domain)
            //}
            });
            }

    function SelectBuy() {
    var Country = $("#productState").val();
    var stlectVaule = $("#selectValue").val();
    //   jQuery('#ManageProductListView').showLoading();
    $.post('/BrushProduc/BrushProducBind?bindType=2', "pageIndex=1" + "&Country=" + Country + "&stlectVaule=" + stlectVaule,
            function(data) {
            $("#ManageProductListView").html(data); //这里是重点，右侧数据获取后要显示到div中
            //   jQuery('#ManageProductListView').hideLoading();        //任务执行成功，关闭进度条
            },
            "text");
    }

    function BindSellDetail() {
    var title = '添加';
    var index = $.layer({
    type: 1,
            title: title,
            shadeClose: false,
            maxmin: false,
            fix: false,
            area: ['430px', 300],
            page: {
            url: "{:U('Store/bindStore')}",
            }
    });
    }
    function modifyStore(id){
    var index = $.layer({
    type: 1,
            title: '编辑',
            shadeClose: false,
            maxmin: false,
            fix: false,
            area: ['430px', '300'],
            page: {
            url: "{:U('Store/modifyStore')}?id=" + id,
            }
    });
    }

    //删除角色
    function entityDel(entityId) {
    layer.confirm('确定删除吗？',
            function(index) {

            $.ajax({
            url: "{:U('Store/delStore')}",
                    type: "post",
                    dataType: "json",
                    data: {
                    id: entityId,
                    },
                    success: function(data) {
                    if (data.status == 1) {
                    layer.alert(data.info, 1);
                    GetManageProductList('1');
                    } else {

                    layer.alert(data.info, 3);
                    }
                    //重新加载数据

                    },
                    error: function(err) {
                    layer.alert(data.Msg, 3);
                    }
            })

                    layer.close(index)
            });
    }

    function GetManageProductList(Index) {
    jQuery('#ManageProductListView').showLoading();
    $.get("{:U('Store/storeList')}", {p:Index}, function(data) {
    $("#ManageProductListView").html(data); //这里是重点，右侧数据获取后要显示到div中
    jQuery('#ManageProductListView').hideLoading(); //任务执行成功，关闭进度条
    }, "text");
    }
</script>